import React from 'react';
import { PageContainer } from '@ant-design/pro-components';
import { Card, Table } from 'antd';

const OperationLogs: React.FC = () => {
  // 示例数据，实际应从API获取
  const dataSource = [
    {
      id: 1,
      username: 'admin',
      operation: '登录系统',
      ip: '192.168.1.1',
      time: '2025-05-22 16:00:00',
      status: '成功'
    },
    // 更多日志数据...
  ];

  const columns = [
    {
      title: 'ID',
      dataIndex: 'id',
      key: 'id',
    },
    {
      title: '用户名',
      dataIndex: 'username',
      key: 'username',
    },
    {
      title: '操作',
      dataIndex: 'operation',
      key: 'operation',
    },
    {
      title: 'IP地址',
      dataIndex: 'ip',
      key: 'ip',
    },
    {
      title: '操作时间',
      dataIndex: 'time',
      key: 'time',
    },
    {
      title: '状态',
      dataIndex: 'status',
      key: 'status',
    },
  ];

  return (
    <PageContainer>
      <Card title="操作日志" bordered={false}>
        <Table dataSource={dataSource} columns={columns} rowKey="id" />
      </Card>
    </PageContainer>
  );
};

export default OperationLogs;
